import pymysql

db = pymysql.connect(host = "192.168.13.92", port = 3306, user = "test",
                     password = "123456", database = "school_db", charset = "utf8")
cursor = db.cursor()
#sql = "create table person(username varchar(20), age int, sex char(4), high double(3,2))"
for i in range(1, 11):
    str_1 = input("请输入信息（姓名，年龄，性别，身高），以空格做分隔：")
    str_2 = str_1.split()
    sql = f"insert into person values('{str_2[0]}',{int(str_2[1])},'{str_2[2]}',{float(str_2[3])})"
    cursor.execute(sql)
    db.commit()
cursor.close()
db.close()